﻿#include "ModuleLoaderTest.h"
#include "Directory/Directory.h"
#include "TyzLibCurl/ITyzLibCurl.h"

using namespace SystemTool;
using namespace SystemTool::IO;

int TestModuleLoader()
{
	try
	{
		std::string strLibPath = Directory::GetExcutableDirectory() + "TyzLibCurl.dll";

		ModuleLoader<ITyzLibCurl> MyLoader(strLibPath);

		ITyzLibCurl* pCurl = MyLoader.GetModuleInterface();

		if (pCurl == NULL)
		{
			return 0;
		}

		std::string strVersion = pCurl->GetCurVersion();

		std::cout << strVersion << std::endl;
	}
	catch (BSException& e)
	{
		std::cout << e.ErrorMsg() << std::endl;

		return -1;
	}

	return 0;
}
